{{ $pag := $.Paginator }}
{{ if gt $pag.TotalPages 1 }}
    <nav class="pagination" role="navigation">
        <span class="page-number">Page {{ $pag.PageNumber }} of {{ $pag.TotalPages }}</span>
        {{ if $pag.HasPrev }}
            <a class="newer-posts" href="{{ $pag.Prev.URL }}">&larr; Newer Posts</a>
        {{ end }}
        {{ if $pag.HasNext }}
            <a class="older-posts" href="{{ $pag.Next.URL }}">Older Posts &rarr;</a>
        {{ end }}
    </nav>
{{ end }}